# SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause
%YAML 1.2
---
$id: "http://devicetree.org/schemas/usb/st,stusb160x.yaml#"
$schema: "http://devicetree.org/meta-schemas/core.yaml#"

title: STMicroelectronics STUSB160x Type-C controller

maintainers:
  - Amelie Delaunay <amelie.delaunay@foss.st.com>

properties:
  compatible:
    enum:
      - st,stusb1600

  reg:
    maxItems: 1

  interrupts:
    maxItems: 1

  vdd-supply:
    description: main power supply (4.1V-22V)

  vsys-supply:
    description: low power supply (3.0V-5.5V)

  vconn-supply:
    description: power supply (2.7V-5.5V) used to supply VConn on CC pin in
      source or dual power role

  connector:
    type: object
    $ref: /schemas/connector/usb-connector.yaml#
    unevaluatedProperties: false

    properties:
      compatible:
        const: usb-c-connector

      power-role: true

      typec-power-opmode: true

    required:
      - compatible

required:
  - compatible
  - reg
  - connector

additionalProperties: false

examples:
  - |
    #include <dt-bindings/interrupt-controller/irq.h>
    i2c4 {
        #address-cells = <1>;
        #size-cells = <0>;

        typec: stusb1600@28 {
            compatible = "st,stusb1600";
            reg = <0x28>;
            vdd-supply = <&vbus_drd>;
            vsys-supply = <&vdd_usb>;
            interrupts = <11 IRQ_TYPE_EDGE_FALLING>;
            interrupt-parent = <&gpioi>;

            typec_con: connector {
                compatible = "usb-c-connector";
                label = "USB-C";
                power-role = "dual";
                data-role = "dual";
                typec-power-opmode = "default";

                ports {
                    #address-cells = <1>;
                    #size-cells = <0>;
                    port@0 {
                        reg = <0>;
                        typec_con_ep: endpoint {
                            remote-endpoint = <&usbotg_hs_ep>;
                        };
                    };
                };
            };
        };
    };
...
